'''
Created on Aug 21, 2012

@author: Justin
'''

from scipy.io import wavfile

class Sound(object):
  
  def __init__(self, wav):
    '''Why isn't wav a WAV file?'''
    self.sampleRate, self.data = wavfile.read(wav)
  
  def indices(self, bitRate):
    n = 2**bitRate
    h = 2/n
    wav2index = lambda value : (value + 1)/h + 1
    return wav2index(self.data)


class SoundMap(object):
  
  
  def __init__(self, sound):
    self.range = self.getRange(sound)
    
  
  def getRange(self, sound):
    pass